import 'package:mahjong/entity/MessageContext.dart';
import 'package:mahjong/notify/CurrentUserInfo.dart';
import 'package:mahjong/util/AudioPlayUtil.dart';
import 'package:provider/provider.dart';

import 'AbstractMessageHandler.dart';
import 'package:mahjong/const/MahjongConst.dart';

class MessageCardCall extends AbstractMessageHandler {
  void doMessage(MessageContext message) {
    var currentUser = Provider.of<CurrentUserInfo>(navigatorKey.currentContext,
        listen: false);
    if (message.userId != currentUser.userId) {
      AudioPlayUtil.playAudioAction(message.action);
      diskPartUserProvider[message.userId].showAction(message.action);
    }
    diskPartUserProvider[message.userId].cardCall();
  }
}
